#!/bin/sh
state="$(dbus-send --system --dest=org.freedesktop.Avahi --print-reply / org.freedesktop.Avahi.Server.GetState | grep int32 | awk '{printf $2}')"

# Avahi will return 'state=2' when 'Server startup complete'
if [ "$state" = 2 ]; then
    exit 0
else
    exit 1
fi

